package com.sanjiahantang.youjiarole.module.store.views.impl;

import android.view.View;
import android.widget.BaseAdapter;
import android.widget.ListView;
import android.widget.TextView;

import com.sanjiahantang.youjiarole.R;
import com.sanjiahantang.youjiarole.base.BaseMvpActivity;
import com.sanjiahantang.youjiarole.module.store.preseneters.StorePresenter;
import com.sanjiahantang.youjiarole.module.store.views.StoreView;


/**
 * Created by zy on 2017/9/20.
 */

public class StoreActivity extends BaseMvpActivity<StoreView,StorePresenter> implements StoreView, View.OnClickListener,StoreView.OnLoadListener {

    private View back;
    private ListView listView;

    @Override
    public void showProgress() {
        super.showProgress($this);
    }

    @Override
    public StorePresenter initPresenter() {
        return new StorePresenter();
    }

    @Override
    public void initView() {
        setContentView(R.layout.activity_common_list);
        back = findViewById(R.id.fl_Left);
        TextView title = (TextView) findViewById(R.id.title);
        title.setText("体验店");
        back.setOnClickListener(this);

        listView = (ListView) findViewById(R.id.listView);
        listView.setSelector(getResources().getDrawable(R.color.transparent));
    }

    @Override
    public void initData() {
        presenter.loadData($this,this);
    }

    @Override
    public void onClick(View v) {
        switch (v.getId()){
            case R.id.fl_Left:
                finish();
                break;
        }
    }

    @Override
    public void initListView(BaseAdapter adapter) {
        listView.setAdapter(adapter);
    }
}
